<?php include './pages/reportMenu.php'; ?>
<div id="profit">
	<div id="searchArea">
		<div id="form">
			<form action="./system/action/viewProfit.php" method="POST">
				Start Date: <input type="text" name="startDate" class="datePicker"/>
				End Date: <input type="text" name="endDate" class="datePicker"/>
				<input type="submit" value="Get Profit"/>
			</form>
		</div>
		<div id="totalIncome">
			<?php 
			if(isset($_SESSION['totalIncome'])){
				echo 'total Income: '.$_SESSION['totalIncome'].' /=</br>';
				unset($_SESSION['totalIncome']);
			}
			if(isset($_SESSION['totalExpenditure'])){
				echo 'total Expenditure: '.$_SESSION['totalExpenditure'].' /=</br>';
				unset($_SESSION['totalExpenditure']);
			}
			if(isset($_SESSION['totalProfit'])){
				echo 'total Profit: '.$_SESSION['totalProfit'].' /=';
				unset($_SESSION['totalProfit']);
			}
			?>
		</div>
	</div>
	<div id="viewArea">
		<?php 
		if(isset($_SESSION['profit'])){
			echo $_SESSION['profit'];
			unset($_SESSION['profit']);
		}
		
		if(isset($_SESSION['error']) && $_SESSION['error'] != ""){ ?>
			<div class="error">
				<?php echo $_SESSION['error']; ?>
			</div>
		<?php } else if(isset($_SESSION['success']) && $_SESSION['success'] != ""){?>
			<div class="success">
				<?php// echo $_SESSION['success']; ?>
			</div>
		<?php }
		?>
	</div>
</div>